package hy.config;

import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AliCfg {
    //用于产生alipayClient实例并注入配置
    @Bean(name="alipayClient")
    public DefaultAlipayClient alipayClient(){
        DefaultAlipayClient alipayClient =
                new DefaultAlipayClient("https://openapi.alipaydev.com/gateway.do"
                        ,"2016100100639965"
                        ,"MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCJIIYcaSxUfWM6jX1aPKp9PiVKvzvl53fXytmtHcf1z9iJ5wDKX1umE+VMNG1tNkOegkWt0IEQSfP/oUTze2F2UPrIldMsaCFHn4cPeulxzN6TJLlD2FbPvBtB90brJfUm5qVS3qLX+bYXSCvBiNf8CajuaV+JPyQTdM+IAfBRjkLReDfn4X+TqkRNjW3iSMgeCxOLtAmRqL7Oqk/BvtPKNY5YZqNiBCPSNK9EMx0v8lPlwUpm0BkzRc9QbpkZ23FV00qbUVpZfDkchfc4pTevY3aFyYOqGoWf2LtvBbA5eH3hA4AEgkxiVBUOvTUaUNXXM58KJPwhmnn2iBqzmdpRAgMBAAECggEAOMwQ4Gmro98/n3wFZL/l+fQorBojbCmAmQ/7M1o3fZg2X4Af8rKmmlZ5TiQVAvxL67aXt9O58Y5AEyywC42aI9CM31I3YphK2Ii5/25wjONHeXjnh7Nu2aJXQ+5xIGrbbN5xsa5nkr9qbaBGB2Zv14QExaM9n/JYNfrXDsWGzbBcQe0CyMZFOX0lvCybwjSfsMEF4e+0ttZMxZV6w/RekTzSW14yHzSp51emrVOBFDVWBj+n56GGTxcZL+ri7iPe7KHlW+Pc70SbpkUJSiiTGWFKpBX3wGAjS7BpvMZOt1cU4JobHYXhC9r6N+YGrDSE7W4TgPKbNE/taGuMRdf2AQKBgQDLMt/5bG5Da4aenzgtLpXpJwaPZmF7aXhBS0VEBJ5+dscjGd3VmPA5/lcAP3wwGKcQYbuRGqjnLzgCVASOngyjPCp/N8Q4MJ5i1MsLHmk8fk8/jHxt1tcPKIp9b0dGvV9gZ+88gPlPe2JgSZImK83/x9EPGZ2d1NcT5lo27kLQMQKBgQCswnK9iVTxcq+9eNG4tgixSa591kIcePu1p/cR0Uwuh/nsdFAvmSlnvRXTQuZXLmBz3xu+TXNUwNO7grCTWmMHZbFDcgaJyM7yT05b0XxyrknZAshlG2apZ1K3wjxH4GgHwbmbl4TjuWvaheKO4KyapXU1KHsbWePHAkdT3LBEIQKBgBXwdEZV8sHMxkgyILqgIQd/czHgd/3/MUC7g8sIRKSa5n1fuZfqX2WjlHkuYZY/0ynto3bTThFIA+AcejF71xl40Y3S05jNhwxctV+J9QrXCG9wF680VxwH4IwSi7uTjsy17Bq4QjLWu5Rx3RnJ+P/47xWWSnJUHLTFVlBAAW7BAoGAQwI5FyNJe02MtOVEE20n+fwmXlDY28phd5hq0NJpxjKf0gNbhtrVoJNK/+KXDYHDj64eSLYp4dnZRoXuj3kjqB7dntd/iboF6x6vuhWLO8A2jKHzsKPsMhENmJESaJ62Oyv9HkirFtk46E2+DsU+rc03pSLKfVVkcDCGEhUrmYECgYBqCwa8yjunZ/SApJDS9kLaInIJESBSB3dtlHv/V9bIaifHaKVRUTDfTzwDQX1tsDswAuVMGmJ+VhnUou5aHSecPlQtBnM++eBdSckjz+wHH/ClfH6OvQGcs3Wkr2GigtfKSwB2tK47gxHpCq4dTBHfM6857sb5vImdVkiezjNUMQ=="
                        ,"json"
                        ,"utf-8"
                        ,"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsgi2aVVSiPD0Dxw5Avy+NTIWmAqLxnuBl72wiW31R1L62v6t80Gqi9xcDKgsNPx+zDAgyntLLGl3gQt0eIjOTol/ZKMK2NHbga1DOu1AEAqFGC943MZORknpMVvNaXKzkIrK0V7t6o3pBmbsYzgPHXCCSvNLhjGLio7/TPtXEyg5WTHfZb4sq0adHf6Rcarc+NytR7QhaWu/kkg84Deee3Q0TYLRCt2YyDTZg/4upHHSnKnsE/0KgRjwZkaXwvhzoHSOIhJJM0FhWMUgavwFHjiol1LcppfPhH9cJIZMorB+Z1Z9P4ACTHFKMPRhRVyYrjPdqpaQipknaOXt70xDHQIDAQAB"
                        ,"RSA2");//RSA2是加密方式
        return alipayClient;
    }
}